package cn.echo.ecc.fallback;

import cn.echo.ecc.feign.CourseService;
import cn.echo.ecc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseServiceFallbackFactory implements FallbackFactory<CourseService> {
    @Override
    public CourseService create(Throwable throwable) {
        return new CourseService() {
            @Override
            public JSONResult courseOrderInfo(String courseIds) {
                return JSONResult.error();
            }

            @Override
            public JSONResult get(Long id) {
                return JSONResult.error();
            }
        };
    }
}
